# (1) range(10)
# print(list(range(100)))

# (2) str
# x = 100
# print(str(x))  # '100'
# l = [1, 2, 3]
# d = {"name": "yuan"}
# s1 = str(l)
# s2 = str(d)
# print(s1, type(s1))  # '[1, 2, 3]'
# print(s2, type(s2))  # "{'name': 'yuan'}"

# (3) repr

# l = [1, 2, 3]
# d = {"name": "yuan"}
# s1 = repr(l)
# s2 = repr(d)
# print(s1, type(s1))  # '[1, 2, 3]'
# print(s2, type(s2))  # "{'name': 'yuan'}"

# 补充 repr和str区别
# import datetime
#
# now = datetime.datetime.now()
# print(str(now), type(str(now)))
# print(repr(now), type(repr(now)))

# (4) bool
# print(bool(0))
# print(bool(100))
# print(bool(-1))
# print(bool(-100))
# print(bool(""))
# print(bool(" "))
# print(bool("0"))
# print(bool("False"))

# (5)  list tuple set
# l = [1, 2, 3, 3, 2, 2]
# print(list(set(l)))
# s = "hello yuan"
# print(list(s))
# print(tuple(s))
# print(tuple(l))

# (6) bin hex oct 将十进制转换
# x = 17
# print(bin(x))  # 0b10001
# print(hex(x))  # 0x11
# print(oct(x))  # 0o21

# (7) abs
# x = -123
# print(abs(x))
# print(pow(2, 3))
# print(pow(2, 4))
# print(pow(3, 4))

# (8) max min sum
# l = [12, 3, 4, 45]
# print(max(l))
# print(min(l))
# print(sum(l))


# print(max({4, 5, 1, 8, 9, 3}))
# print(min({4, 5, 1, 8, 9, 3}))
# print(sum({4, 5, 1, 8, 9, 3}))

# print(max({2: "apple", 1: "banana", 3: "peach"}))
# print(min({2: "apple", 1: "banana", 3: "peach"}))
# print(sum({2: "apple", 1: "banana", 3: "peach"}))
